//
//  NSArray+Mutable.m
//  UtilsDemo
//
//  Created by yunsheng on 15/4/22.
//  Copyright (c) 2015年 yunsheng. All rights reserved.
//

#import "NSArray+Mutable.h"

#import "NSDictionary+Mutable.h"

@implementation NSArray (Mutable)

-(NSMutableArray *)toMutableArrayCascade
{
    NSMutableArray * mArr = [[NSMutableArray alloc] init];
    
    for (int i = 0; i < self.count; i++) {
        id obj = [self objectAtIndex:i];
        if ([obj isKindOfClass:[NSArray class]]) {
            [mArr addObject:[obj toMutableArrayCascade]];
        } else if ([obj isKindOfClass:[NSDictionary class]]) {
            [mArr addObject:[obj toMutableDicCascade]];
        } else {
            [mArr addObject:obj];
        }
    }
    
    return mArr;
}

@end
